package userInterface;

import java.awt.Color;

public class Text extends DrawObject 
{
	public Text(Point location, int size, String text, Color color)
	{
		super(color);
		super.setShape(Shape.TEXT);
		_location = location;
		_size = size;
		_text = text;
	}
	
	public Text(Text t)
	{
		super(t.getColor());
		super.setShape(Shape.TEXT);
		_location = new Point(t.getLocation().X, t.getLocation().Y);
		_size = t.getSize();
		_text = t.getText();
	}

	public Point getLocation()
	{
		return _location;
	}
	
	public void setLocation(Point location)
	{
		_location = location;
		for (DrawingModel m : _models)
			m.modelChanged();
	}
	
	public int getSize()
	{
		return _size;
	}
	
	public void setSize(int size)
	{
		_size = size;
		for (DrawingModel m : _models)
			m.modelChanged();
	}
	
	public String getText()
	{
		return _text;
	}
	
	public void setText(String text)
	{
		_text = text;
		for (DrawingModel m : _models)
			m.modelChanged();
	}

	@Override
	public void move(int x, int y)
	{
		_location = new Point(_location.X + x, _location.Y + y);
		for (DrawingModel m : _models)
			m.modelChanged();
	}

	private Point _location;
	
	private int _size;
	
	private String _text;
}
